/*
 * @Author: 贾博林 11457230+jabolin@user.noreply.gitee.com
 * @Date: 2022-10-24 15:52:59
 * @LastEditors: 贾博林 11457230+jabolin@user.noreply.gitee.com
 * @LastEditTime: 2022-10-26 20:40:52
 * @FilePath: \my黑马\code\src\http\roles\api.js
 * @Description:roles.api
 */

import request from '../request'

// roles渲染数据
export function roles(data) {
    return request({
        url: "roles",
        method: "get",
        data
    })
}

// roles树状图渲染数据
export function rolesList() {
    return request({
        url: "rights/tree",
        method: "get",
        
    })
}
// roles树状图添加数据
export function addRoleRights(roleId,data) {
    return request({
        url: "roles/"+roleId+"/rights",
        method: "post",
        data
    })
}

// roles添加
export function roles_tjjs(data) {
    return request({
        url: "roles",
        method: "post",
        data
    })
}

// roles编辑
export function roles_xgjs(data) {
    console.log(data, 'data');
    return request({
        url: `roles/${data.id}`,
        method: 'put',
        data
    })
}

// roles删除
export function roles_scjs(data) {
    return request({
        url: `roles/${data.id}`,
        method: "delete",
        data
    })
}


// roles删除标签
export function shanchu(rowId, rightId) {
    return request({
        url: `roles/${rowId}/rights/${rightId}`,
        method: "delete",
    });
}


